using System;
using System.Collections.Generic;
using Entitas;

public sealed class RenderPositionSystem : ReactiveSystem {

    public RenderPositionSystem(Contexts contexts) : base(contexts.core)
    {
    }

    public RenderPositionSystem(Context context) : base(context) {}


    protected override void Execute(List<Entity> entities) {
        foreach(var e in entities) {
            e.view.controller.position = e.position.value;
        }
    }

    protected override Collector GetTrigger(Context context)
    {
        return context.CreateCollector(Matcher.AllOf(CoreMatcher.View, CoreMatcher.Position));
    }

    protected override bool Filter(Entity entity)
    {
        return true;
    }
}
